package org.cid54.bukkit.command;

import org.bukkit.entity.CreatureType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerChatEvent;
import org.cid54.bukkit.Cid54PlayerListener;
import org.cid54.bukkit.command.util.PlayerCommand;

/**
 *
 * @author Cid54
 */
public class KillCommand implements PlayerCommand {

    @Override
    public boolean execute(String command, PlayerChatEvent event, Cid54PlayerListener listener) {

        for (LivingEntity ent : event.getPlayer().getWorld().getLivingEntities()) {

            if (!(ent instanceof Player)) {
                ent.damage(100);
            }

        }
        
        return true;

    }

    @Override
    public String getCommand() {
        return "kill";
    }

    @Override
    public String getHelpText() {
        return "Kill all non players";
    }
}
